package com.steve.rocketmq;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Author: STEVE
 * @Description: 延迟消息消费者
 * @since: 2025-07-17
 */
@Component
@RocketMQMessageListener(
        topic = "DELAY_TOPIC",  // 主题名称
        consumerGroup = "delay-consumer-group"  // 消费者组名
)
public class DelayMessageListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        System.out.println("收到延迟消息：" + message + "，时间：" + System.currentTimeMillis());
    }

}
